package org.ust.analyse;

import java.util.ArrayList;
import java.util.Iterator;

public class MethodInvocationStructure
{

	private ArrayList < String >	typeArguments;
	private String					staticMethodExpression;
	private ArrayList < String >	arguments;
	private String					methodName;

	public ArrayList < String > getArguments ( )
	{
		return arguments;
	}

	public void setTypeArguments ( ArrayList < String > typeArguments )
	{
		this.typeArguments = typeArguments;
	}

	public ArrayList < String > getTypeArguments ( )
	{
		return typeArguments;
	}

	public void setStaticMethodExpression ( String staticMethodExpression )
	{
		this.staticMethodExpression = staticMethodExpression;
	}

	public void setArguments ( ArrayList < String > arguments )
	{
		this.arguments = arguments;
	}

	public String getStaticMethodExpression ( )
	{
		return staticMethodExpression;
	}

	public void setMethodName ( String methodName )
	{
		this.methodName = methodName;
	}

	public String getMethodName ( )
	{
		return methodName;
	}

	@ SuppressWarnings ( "unchecked" )
	@ Override
	public String toString ( )
	{
		String output = "";
		if ( getStaticMethodExpression ( ) != null )
		{
			output = getStaticMethodExpression ( ).toString ( ) + " ";
		}

		if ( getTypeArguments ( ) != null && getTypeArguments ( ).size ( ) > 0 )
		{
			Iterator it = getTypeArguments ( ).iterator ( );
			while ( it.hasNext ( ) )
			{
				String type = it.next ( ).toString ( );
				output += type + " ";
			}
		}

		output += getMethodName ( ) + " ";

		if ( getArguments ( ) != null && getArguments ( ).size ( ) > 0 )
		{
			Iterator it = getArguments ( ).iterator ( );
			while ( it.hasNext ( ) )
			{
				String type = it.next ( ).toString ( );
				output += type + " ";
			}
		}

		return output;
	}
}
